\(\int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{(a+a \sin (c+d x))^3} \, dx\) [794]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 162 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{(a+a \sin (c+d x))^3} \, dx=\frac {3 \text {arctanh}(\cos (c+d x))}{a^3 d}-\frac {\cot (c+d x)}{a^3 d}-\frac {3 \sec (c+d x)}{a^3 d}-\frac {\sec ^3(c+d x)}{a^3 d}-\frac {3 \sec ^5(c+d x)}{5 a^3 d}-\frac {4 \sec ^7(c+d x)}{7 a^3 d}+\frac {7 \tan (c+d x)}{a^3 d}+\frac {5 \tan ^3(c+d x)}{a^3 d}+\frac {13 \tan ^5(c+d x)}{5 a^3 d}+\frac {4 \tan ^7(c+d x)}{7 a^3 d} \]

[Out]

3*arctanh(cos(d*x+c))/a^3/d-cot(d*x+c)/a^3/d-3*sec(d*x+c)/a^3/d-sec(d*x+c)^3/a^3/d-3/5*sec(d*x+c)^5/a^3/d-4/7*
sec(d*x+c)^7/a^3/d+7*tan(d*x+c)/a^3/d+5*tan(d*x+c)^3/a^3/d+13/5*tan(d*x+c)^5/a^3/d+4/7*tan(d*x+c)^7/a^3/d

Rubi [A] (verified)

Time = 0.26 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.345, Rules used = {2954, 2952, 3852, 2702, 308, 213, 2700, 276, 2686, 30} \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{(a+a \sin (c+d x))^3} \, dx=\frac {3 \text {arctanh}(\cos (c+d x))}{a^3 d}+\frac {4 \tan ^7(c+d x)}{7 a^3 d}+\frac {13 \tan ^5(c+d x)}{5 a^3 d}+\frac {5 \tan ^3(c+d x)}{a^3 d}+\frac {7 \tan (c+d x)}{a^3 d}-\frac {\cot (c+d x)}{a^3 d}-\frac {4 \sec ^7(c+d x)}{7 a^3 d}-\frac {3 \sec ^5(c+d x)}{5 a^3 d}-\frac {\sec ^3(c+d x)}{a^3 d}-\frac {3 \sec (c+d x)}{a^3 d} \]

[In]

Int[(Csc[c + d*x]^2*Sec[c + d*x]^2)/(a + a*Sin[c + d*x])^3,x]

[Out]

(3*ArcTanh[Cos[c + d*x]])/(a^3*d) - Cot[c + d*x]/(a^3*d) - (3*Sec[c + d*x])/(a^3*d) - Sec[c + d*x]^3/(a^3*d) -
 (3*Sec[c + d*x]^5)/(5*a^3*d) - (4*Sec[c + d*x]^7)/(7*a^3*d) + (7*Tan[c + d*x])/(a^3*d) + (5*Tan[c + d*x]^3)/(
a^3*d) + (13*Tan[c + d*x]^5)/(5*a^3*d) + (4*Tan[c + d*x]^7)/(7*a^3*d)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 276

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rule 308

Int[(x_)^(m_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^n, x], x] /; FreeQ[{a,
b}, x] && IGtQ[m, 0] && IGtQ[n, 0] && GtQ[m, 2*n - 1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2700

Int[csc[(e_.) + (f_.)*(x_)]^(m_.)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(1 + x^2)^((
m + n)/2 - 1)/x^m, x], x, Tan[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n)/2]

Rule 2702

Int[csc[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Dist[1/(f*a^n), Subst[Int
[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n
 + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rule 2952

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^(m_), x_Symbol] :> Int[ExpandTrig[(g*cos[e + f*x])^p, (d*sin[e + f*x])^n*(a + b*sin[e + f*x])^m, x], x]
 /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && IGtQ[m, 0]

Rule 2954

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^(m_), x_Symbol] :> Dist[(a/g)^(2*m), Int[(g*Cos[e + f*x])^(2*m + p)*((d*Sin[e + f*x])^n/(a - b*Sin[e +
f*x])^m), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && ILtQ[m, 0]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \csc ^2(c+d x) \sec ^8(c+d x) (a-a \sin (c+d x))^3 \, dx}{a^6} \\ & = \frac {\int \left (3 a^3 \sec ^8(c+d x)-3 a^3 \csc (c+d x) \sec ^8(c+d x)+a^3 \csc ^2(c+d x) \sec ^8(c+d x)-a^3 \sec ^7(c+d x) \tan (c+d x)\right ) \, dx}{a^6} \\ & = \frac {\int \csc ^2(c+d x) \sec ^8(c+d x) \, dx}{a^3}-\frac {\int \sec ^7(c+d x) \tan (c+d x) \, dx}{a^3}+\frac {3 \int \sec ^8(c+d x) \, dx}{a^3}-\frac {3 \int \csc (c+d x) \sec ^8(c+d x) \, dx}{a^3} \\ & = -\frac {\text {Subst}\left (\int x^6 \, dx,x,\sec (c+d x)\right )}{a^3 d}+\frac {\text {Subst}\left (\int \frac {\left (1+x^2\right )^4}{x^2} \, dx,x,\tan (c+d x)\right )}{a^3 d}-\frac {3 \text {Subst}\left (\int \frac {x^8}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{a^3 d}-\frac {3 \text {Subst}\left (\int \left (1+3 x^2+3 x^4+x^6\right ) \, dx,x,-\tan (c+d x)\right )}{a^3 d} \\ & = -\frac {\sec ^7(c+d x)}{7 a^3 d}+\frac {3 \tan (c+d x)}{a^3 d}+\frac {3 \tan ^3(c+d x)}{a^3 d}+\frac {9 \tan ^5(c+d x)}{5 a^3 d}+\frac {3 \tan ^7(c+d x)}{7 a^3 d}+\frac {\text {Subst}\left (\int \left (4+\frac {1}{x^2}+6 x^2+4 x^4+x^6\right ) \, dx,x,\tan (c+d x)\right )}{a^3 d}-\frac {3 \text {Subst}\left (\int \left (1+x^2+x^4+x^6+\frac {1}{-1+x^2}\right ) \, dx,x,\sec (c+d x)\right )}{a^3 d} \\ & = -\frac {\cot (c+d x)}{a^3 d}-\frac {3 \sec (c+d x)}{a^3 d}-\frac {\sec ^3(c+d x)}{a^3 d}-\frac {3 \sec ^5(c+d x)}{5 a^3 d}-\frac {4 \sec ^7(c+d x)}{7 a^3 d}+\frac {7 \tan (c+d x)}{a^3 d}+\frac {5 \tan ^3(c+d x)}{a^3 d}+\frac {13 \tan ^5(c+d x)}{5 a^3 d}+\frac {4 \tan ^7(c+d x)}{7 a^3 d}-\frac {3 \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{a^3 d} \\ & = \frac {3 \text {arctanh}(\cos (c+d x))}{a^3 d}-\frac {\cot (c+d x)}{a^3 d}-\frac {3 \sec (c+d x)}{a^3 d}-\frac {\sec ^3(c+d x)}{a^3 d}-\frac {3 \sec ^5(c+d x)}{5 a^3 d}-\frac {4 \sec ^7(c+d x)}{7 a^3 d}+\frac {7 \tan (c+d x)}{a^3 d}+\frac {5 \tan ^3(c+d x)}{a^3 d}+\frac {13 \tan ^5(c+d x)}{5 a^3 d}+\frac {4 \tan ^7(c+d x)}{7 a^3 d} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(351\) vs. \(2(162)=324\).

Time = 1.17 (sec) , antiderivative size = 351, normalized size of antiderivative = 2.17 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{(a+a \sin (c+d x))^3} \, dx=\frac {\csc ^3(c+d x) \left (-966-440 \cos (2 (c+d x))-2640 \cos (3 (c+d x))+846 \cos (4 (c+d x))+176 \cos (5 (c+d x))-1575 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+105 \cos (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+14 \cos (c+d x) \left (176+105 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-105 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+1575 \cos (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-105 \cos (5 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-1316 \sin (c+d x)+3520 \sin (2 (c+d x))+2100 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (2 (c+d x))-2100 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (2 (c+d x))-1380 \sin (3 (c+d x))-1056 \sin (4 (c+d x))-630 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (4 (c+d x))+630 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (4 (c+d x))+176 \sin (5 (c+d x))\right )}{140 a^3 d \left (\csc ^2\left (\frac {1}{2} (c+d x)\right )-\sec ^2\left (\frac {1}{2} (c+d x)\right )\right ) (1+\sin (c+d x))^3} \]

[In]

Integrate[(Csc[c + d*x]^2*Sec[c + d*x]^2)/(a + a*Sin[c + d*x])^3,x]

[Out]

(Csc[c + d*x]^3*(-966 - 440*Cos[2*(c + d*x)] - 2640*Cos[3*(c + d*x)] + 846*Cos[4*(c + d*x)] + 176*Cos[5*(c + d
*x)] - 1575*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2]] + 105*Cos[5*(c + d*x)]*Log[Cos[(c + d*x)/2]] + 14*Cos[c + d
*x]*(176 + 105*Log[Cos[(c + d*x)/2]] - 105*Log[Sin[(c + d*x)/2]]) + 1575*Cos[3*(c + d*x)]*Log[Sin[(c + d*x)/2]
] - 105*Cos[5*(c + d*x)]*Log[Sin[(c + d*x)/2]] - 1316*Sin[c + d*x] + 3520*Sin[2*(c + d*x)] + 2100*Log[Cos[(c +
 d*x)/2]]*Sin[2*(c + d*x)] - 2100*Log[Sin[(c + d*x)/2]]*Sin[2*(c + d*x)] - 1380*Sin[3*(c + d*x)] - 1056*Sin[4*
(c + d*x)] - 630*Log[Cos[(c + d*x)/2]]*Sin[4*(c + d*x)] + 630*Log[Sin[(c + d*x)/2]]*Sin[4*(c + d*x)] + 176*Sin
[5*(c + d*x)]))/(140*a^3*d*(Csc[(c + d*x)/2]^2 - Sec[(c + d*x)/2]^2)*(1 + Sin[c + d*x])^3)

Maple [A] (verified)

Time = 0.95 (sec) , antiderivative size = 164, normalized size of antiderivative = 1.01

method result size
derivativedivides \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {1}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-6 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {16}{7 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{7}}+\frac {8}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{6}}-\frac {92}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}+\frac {26}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}-\frac {31}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {49}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {111}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}}{2 d \,a^{3}}\) \(164\)
default \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {1}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-6 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {16}{7 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{7}}+\frac {8}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{6}}-\frac {92}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}+\frac {26}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}-\frac {31}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {49}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {111}{4 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}}{2 d \,a^{3}}\) \(164\)
parallelrisch \(\frac {-210 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{7} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+35 \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1785 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-6720 \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-10010 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-4200 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+6006 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+9296 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+35 \cot \left (\frac {d x}{2}+\frac {c}{2}\right )+5079 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1144}{70 d \,a^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{7}}\) \(186\)
risch \(-\frac {2 \left (-1540 \,{\mathrm e}^{7 i \left (d x +c \right )}+630 i {\mathrm e}^{8 i \left (d x +c \right )}+966 \,{\mathrm e}^{5 i \left (d x +c \right )}-1890 i {\mathrm e}^{6 i \left (d x +c \right )}+1980 \,{\mathrm e}^{3 i \left (d x +c \right )}-951 \,{\mathrm e}^{i \left (d x +c \right )}+2010 i {\mathrm e}^{2 i \left (d x +c \right )}-176 i-574 i {\mathrm e}^{4 i \left (d x +c \right )}+105 \,{\mathrm e}^{9 i \left (d x +c \right )}\right )}{35 \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{7} \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) d \,a^{3}}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d \,a^{3}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d \,a^{3}}\) \(197\)
norman \(\frac {-\frac {143 \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}+\frac {1}{2 a d}-\frac {60 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}+\frac {\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d a}-\frac {51 \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d a}-\frac {96 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}+\frac {572 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{35 d a}+\frac {664 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d a}+\frac {429 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d a}+\frac {5079 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{70 d a}}{a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{7} \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{3}}\) \(239\)

[In]

int(csc(d*x+c)^2*sec(d*x+c)^2/(a+a*sin(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/2/d/a^3*(tan(1/2*d*x+1/2*c)-1/4/(tan(1/2*d*x+1/2*c)-1)-1/tan(1/2*d*x+1/2*c)-6*ln(tan(1/2*d*x+1/2*c))-16/7/(t
an(1/2*d*x+1/2*c)+1)^7+8/(tan(1/2*d*x+1/2*c)+1)^6-92/5/(tan(1/2*d*x+1/2*c)+1)^5+26/(tan(1/2*d*x+1/2*c)+1)^4-31
/(tan(1/2*d*x+1/2*c)+1)^3+49/2/(tan(1/2*d*x+1/2*c)+1)^2-111/4/(tan(1/2*d*x+1/2*c)+1))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 265, normalized size of antiderivative = 1.64 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{(a+a \sin (c+d x))^3} \, dx=\frac {846 \, \cos \left (d x + c\right )^{4} - 956 \, \cos \left (d x + c\right )^{2} + 105 \, {\left (\cos \left (d x + c\right )^{5} - 5 \, \cos \left (d x + c\right )^{3} - {\left (3 \, \cos \left (d x + c\right )^{3} - 4 \, \cos \left (d x + c\right )\right )} \sin \left (d x + c\right ) + 4 \, \cos \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 105 \, {\left (\cos \left (d x + c\right )^{5} - 5 \, \cos \left (d x + c\right )^{3} - {\left (3 \, \cos \left (d x + c\right )^{3} - 4 \, \cos \left (d x + c\right )\right )} \sin \left (d x + c\right ) + 4 \, \cos \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 2 \, {\left (176 \, \cos \left (d x + c\right )^{4} - 477 \, \cos \left (d x + c\right )^{2} + 15\right )} \sin \left (d x + c\right ) + 40}{70 \, {\left (a^{3} d \cos \left (d x + c\right )^{5} - 5 \, a^{3} d \cos \left (d x + c\right )^{3} + 4 \, a^{3} d \cos \left (d x + c\right ) - {\left (3 \, a^{3} d \cos \left (d x + c\right )^{3} - 4 \, a^{3} d \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )\right )}} \]

[In]

integrate(csc(d*x+c)^2*sec(d*x+c)^2/(a+a*sin(d*x+c))^3,x, algorithm="fricas")

[Out]

1/70*(846*cos(d*x + c)^4 - 956*cos(d*x + c)^2 + 105*(cos(d*x + c)^5 - 5*cos(d*x + c)^3 - (3*cos(d*x + c)^3 - 4
*cos(d*x + c))*sin(d*x + c) + 4*cos(d*x + c))*log(1/2*cos(d*x + c) + 1/2) - 105*(cos(d*x + c)^5 - 5*cos(d*x +
c)^3 - (3*cos(d*x + c)^3 - 4*cos(d*x + c))*sin(d*x + c) + 4*cos(d*x + c))*log(-1/2*cos(d*x + c) + 1/2) + 2*(17
6*cos(d*x + c)^4 - 477*cos(d*x + c)^2 + 15)*sin(d*x + c) + 40)/(a^3*d*cos(d*x + c)^5 - 5*a^3*d*cos(d*x + c)^3
+ 4*a^3*d*cos(d*x + c) - (3*a^3*d*cos(d*x + c)^3 - 4*a^3*d*cos(d*x + c))*sin(d*x + c))

Sympy [F]

\[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{(a+a \sin (c+d x))^3} \, dx=\frac {\int \frac {\csc ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sin ^{3}{\left (c + d x \right )} + 3 \sin ^{2}{\left (c + d x \right )} + 3 \sin {\left (c + d x \right )} + 1}\, dx}{a^{3}} \]

[In]

integrate(csc(d*x+c)**2*sec(d*x+c)**2/(a+a*sin(d*x+c))**3,x)

[Out]

Integral(csc(c + d*x)**2*sec(c + d*x)**2/(sin(c + d*x)**3 + 3*sin(c + d*x)**2 + 3*sin(c + d*x) + 1), x)/a**3

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 395 vs. \(2 (154) = 308\).

Time = 0.22 (sec) , antiderivative size = 395, normalized size of antiderivative = 2.44 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{(a+a \sin (c+d x))^3} \, dx=-\frac {\frac {\frac {934 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3854 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {6566 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3556 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {3710 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {7070 \, \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} - \frac {4270 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} - \frac {1015 \, \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} + 35}{\frac {a^{3} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {6 \, a^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {14 \, a^{3} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {14 \, a^{3} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {14 \, a^{3} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} - \frac {14 \, a^{3} \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} - \frac {6 \, a^{3} \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} - \frac {a^{3} \sin \left (d x + c\right )^{9}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{9}}} + \frac {210 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{3}} - \frac {35 \, \sin \left (d x + c\right )}{a^{3} {\left (\cos \left (d x + c\right ) + 1\right )}}}{70 \, d} \]

[In]

integrate(csc(d*x+c)^2*sec(d*x+c)^2/(a+a*sin(d*x+c))^3,x, algorithm="maxima")

[Out]

-1/70*((934*sin(d*x + c)/(cos(d*x + c) + 1) + 3854*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + 6566*sin(d*x + c)^3/(
cos(d*x + c) + 1)^3 + 3556*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 - 3710*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 - 70
70*sin(d*x + c)^6/(cos(d*x + c) + 1)^6 - 4270*sin(d*x + c)^7/(cos(d*x + c) + 1)^7 - 1015*sin(d*x + c)^8/(cos(d
*x + c) + 1)^8 + 35)/(a^3*sin(d*x + c)/(cos(d*x + c) + 1) + 6*a^3*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + 14*a^3
*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + 14*a^3*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 - 14*a^3*sin(d*x + c)^6/(cos
(d*x + c) + 1)^6 - 14*a^3*sin(d*x + c)^7/(cos(d*x + c) + 1)^7 - 6*a^3*sin(d*x + c)^8/(cos(d*x + c) + 1)^8 - a^
3*sin(d*x + c)^9/(cos(d*x + c) + 1)^9) + 210*log(sin(d*x + c)/(cos(d*x + c) + 1))/a^3 - 35*sin(d*x + c)/(a^3*(
cos(d*x + c) + 1)))/d

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.15 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{(a+a \sin (c+d x))^3} \, dx=-\frac {\frac {840 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{3}} - \frac {140 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{3}} - \frac {35 \, {\left (12 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 17 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 4\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} a^{3}} + \frac {3885 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 19880 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 45465 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 57120 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 41671 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 16632 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2931}{a^{3} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}^{7}}}{280 \, d} \]

[In]

integrate(csc(d*x+c)^2*sec(d*x+c)^2/(a+a*sin(d*x+c))^3,x, algorithm="giac")

[Out]

-1/280*(840*log(abs(tan(1/2*d*x + 1/2*c)))/a^3 - 140*tan(1/2*d*x + 1/2*c)/a^3 - 35*(12*tan(1/2*d*x + 1/2*c)^2
- 17*tan(1/2*d*x + 1/2*c) + 4)/((tan(1/2*d*x + 1/2*c)^2 - tan(1/2*d*x + 1/2*c))*a^3) + (3885*tan(1/2*d*x + 1/2
*c)^6 + 19880*tan(1/2*d*x + 1/2*c)^5 + 45465*tan(1/2*d*x + 1/2*c)^4 + 57120*tan(1/2*d*x + 1/2*c)^3 + 41671*tan
(1/2*d*x + 1/2*c)^2 + 16632*tan(1/2*d*x + 1/2*c) + 2931)/(a^3*(tan(1/2*d*x + 1/2*c) + 1)^7))/d

Mupad [B] (verification not implemented)

Time = 11.88 (sec) , antiderivative size = 274, normalized size of antiderivative = 1.69 \[ \int \frac {\csc ^2(c+d x) \sec ^2(c+d x)}{(a+a \sin (c+d x))^3} \, dx=\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a^3\,d}-\frac {-29\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-122\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-202\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-106\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {508\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{5}+\frac {938\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{5}+\frac {3854\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{35}+\frac {934\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{35}+1}{d\,\left (-2\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9-12\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-28\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-28\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+28\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+28\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+12\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}-\frac {3\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^3\,d} \]

[In]

int(1/(cos(c + d*x)^2*sin(c + d*x)^2*(a + a*sin(c + d*x))^3),x)

[Out]

tan(c/2 + (d*x)/2)/(2*a^3*d) - ((934*tan(c/2 + (d*x)/2))/35 + (3854*tan(c/2 + (d*x)/2)^2)/35 + (938*tan(c/2 +
(d*x)/2)^3)/5 + (508*tan(c/2 + (d*x)/2)^4)/5 - 106*tan(c/2 + (d*x)/2)^5 - 202*tan(c/2 + (d*x)/2)^6 - 122*tan(c
/2 + (d*x)/2)^7 - 29*tan(c/2 + (d*x)/2)^8 + 1)/(d*(12*a^3*tan(c/2 + (d*x)/2)^2 + 28*a^3*tan(c/2 + (d*x)/2)^3 +
 28*a^3*tan(c/2 + (d*x)/2)^4 - 28*a^3*tan(c/2 + (d*x)/2)^6 - 28*a^3*tan(c/2 + (d*x)/2)^7 - 12*a^3*tan(c/2 + (d
*x)/2)^8 - 2*a^3*tan(c/2 + (d*x)/2)^9 + 2*a^3*tan(c/2 + (d*x)/2))) - (3*log(tan(c/2 + (d*x)/2)))/(a^3*d)